import request from '@/utils/request'

export function pageList(data, pageInfo) {
    return request({
        url: '/sys/role/page',
        method: 'post',
        data,
        pageInfo
    })
}
export function remove(data) {
    return request({
        url: '/sys/role/delete',
        method: 'post',
        data
    })
}

export function add(data) {
    return request({
        url: '/sys/role/add',
        method: 'post',
        data
    })
}
export function edit(data) {
    return request({
        url: '/sys/role/edit',
        method: 'post',
        data
    })
}
export function detail(id) {
    return request({
        url: '/sys/role/detail/' + id,
        method: 'get',
    })
}
export function sync(code) {
    return request({
        url: '/sys/role/sync' + (code ? '/' + code : ''),
        method: 'post',
    })
}
export function permissionTree(id) {
    return request({
        url: '/sys/role/permission-tree/' + id,
        method: 'get',
    })
}
export function config(id,data) {
    return request({
        url: '/sys/role/config/' + id,
        method: 'post',
        data
    })
}
